# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=py3-pytest-console-scripts
pkgver=1.4.1
pkgrel=0
pkgdesc="Pytest plugin for testing console scripts"
url="https://github.com/kvas-it/pytest-console-scripts"
arch="noarch"
license="MIT"
depends="py3-pytest"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-setuptools_scm
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/kvas-it/pytest-console-scripts/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir/pytest-console-scripts-$pkgver"

build() {
	SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver \
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# needs py3-pytest-subprocess
	.testenv/bin/python3 -m pytest \
		--deselect tests/test_run_scripts.py::test_run_pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ca82a666f4308cc176d193d732da0bf597204c3e464461fd2ecfa71fdc1f60dc953161d2b99b966985c8c1556d9da80b0a1acfef3ce5545b59ac128cceb37d1d  py3-pytest-console-scripts-1.4.1.tar.gz
"
